<div class="menubox">
	<div class="links">
		<ul>
		<?php
		$menuElements = $menu->getElements();
		?>
		<?php foreach($menuElements as $index => $item): ?>
			<?php if($index == 0): ?>
				<?php include_partial('articlesLeftMenuWidget/leftBox', array('item' => $item)) ?>
			<?php elseif($index == count($menuElements)-1): ?>
				<?php include_partial('articlesLeftMenuWidget/rightBox', array('item' => $item)) ?>
			<?php else: ?>
				<?php include_partial('articlesLeftMenuWidget/centerBox', array('item' => $item)) ?>
			<?php endif; ?>
		<?php endforeach; ?>
			<div class="clear"></div>
		</ul>
	</div>
<script type="text/javascript">
	
var callback = function(p){
	if($(p).attr('loading')==1){

		var elementId = $('input', $(p)).val();

		if($(p).attr('loaded') != 1){
			$.post('<?php echo $dropDownRequestLink ?>', {id: elementId}, function(data){
				$('.maindropcontent',p).html(data);
			});
		}

		$(p).children().addClass('active');
		$(p).attr('loaded', 1);
	}
};

$('.linkbox').hover(function(){
	$(this).attr('loading', 1);

	callback(this);
	//setTimeout(callback, 1000, [this]);
},
function(){
	$(this).attr('loading', false);
	
	if(!$(this).hasClass('active')){
		$(this).children().removeClass('active');
	}else{
		$('.maindrop').removeClass('active');
	}
});
</script>
	<div class="clear"></div>
</div>